﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Extend"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ViewModels="using:Extend.ViewModels"
    xmlns:controls="using:Extend.Controls"
    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
    x:Class="Extend.MainPage"
    mc:Ignorable="d">

    <Page.DataContext>
        <ViewModels:MainPageViewModel/>
    </Page.DataContext>

	<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
		<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
			<TextBox Header="Standard" Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="300" />
			<TextBox Header="Blend behavior" Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="300" >
				<Interactivity:Interaction.Behaviors>
					<controls:MyBehavior Command="{Binding DoCommand, Mode=OneWay}"/>
				</Interactivity:Interaction.Behaviors>
			</TextBox>
            <TextBox Header="Attached property" controls:MyAttached.Command="{Binding DoCommand}" Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="300" />
            <Button Command="{Binding DoCommand}">Click me</Button>
            <TextBlock Text="{Binding Result}" FontSize="26" Margin="0,5" Foreground="Lime" />
        </StackPanel>
	</Grid>
</Page>
